package Year22_Month03.day16;


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a  = sc.nextInt();//其实我完全可以用sc.hasNext()，这里为啥不直接多组输入呢？
        while(a-- > 0){
            int length = sc.nextInt();//定义一个数组的长度
            int count = sc.nextInt();//记录反转的次数
            int[] arr = new int[2 * length];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = sc.nextInt();
            }
            System.out.println();
            fun(arr,count);
        }
        sc.close();
    }

    public static void fun(int[] arr,int count){
        int[] arr2 = new int[arr.length];
        while(count-- > 0){
            int index1 = arr.length / 2 - 1;
            int index2 = arr.length - 1;
            for (int i = arr2.length - 1; i >= 0;i--){
                arr2[i--] = arr[index2--];
                arr2[i] = arr[index1--];
            }
            arr = arr2.clone();
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }
}
